﻿using Orchard.UI.Resources;

namespace DreamStore.WebShop
{
    public class ResourceManifest : IResourceManifestProvider
    {
        public void BuildManifests(ResourceManifestBuilder builder)
        {
            var manifest = builder.Add();

            //Styles
            manifest.DefineStyle("WebShop.Common").SetUrl("common.css");
            manifest.DefineStyle("WebShop.Product").SetUrl("product.css");
            manifest.DefineStyle("WebShop.ShoppingCart").SetUrl("shoppingcart.css").SetDependencies("WebShop.Common");
            manifest.DefineStyle("WebShop.ShoppingCart.Widget").SetUrl("shoppingcart.widget.css").SetDependencies("WebShop.Common");
            manifest.DefineStyle("WebShop.Checkout.Summary").SetUrl("checkout-summary.css").SetDependencies("WebShop.Common");
            manifest.DefineStyle("WebShop.Order").SetUrl("order.css").SetDependencies("WebShop.Common");
            manifest.DefineStyle("WebShop.SimulatedPSP").SetUrl("simulated-psp.css").SetDependencies("WebShop.Common");

            //Scripts
            manifest.DefineScript("KnockoutJS").SetUrl("knockout-2.0.0.js").SetVersion("2.0.0");
            manifest.DefineScript("LinqJS").SetUrl("jquery.linq.min.js").SetVersion("2.2.0.2").SetDependencies("jQuery");
            manifest.DefineScript("Globalize").SetUrl("globalize.js").SetDependencies("jQuery");
            manifest.DefineScript("Globalize.Cultures").SetBasePath(manifest.BasePath + "Scripts/cultures/").SetUrl("globalize.culture.js").SetCultures("da-DK").SetDependencies("Globalize", "jQuery");
            manifest.DefineScript("Globalize.SetCulture").SetUrl("~/DreamStore.WebShop/Resource/SetCultureScript").SetDependencies("Globalize.Cultures");
            manifest.DefineScript("Webshop.ShoppingCart").SetUrl("shoppingcart.js").SetDependencies("jQuery", "KnockoutJS", "LinqJS", "Globalize.SetCulture");

        }
    }
}
